package com.bao.exception;

import com.bao.common.ResultMessage;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created with IntelliJ IDEA.
 * User: bao
 * Date: 2020/05/27 0:21
 * Description:
 * Version: V1.0
 */
@Controller
public class Exception {

    @ExceptionHandler(Throwable.class)
    @ResponseBody
    public ResultMessage handlerException(){
        ResultMessage resultMessage = new ResultMessage();
        resultMessage.setCode(0);
        resultMessage.setMessage("系统出现错误，请联系管理员");
        return  resultMessage;
    }
}
